package com.teach.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import com.teach.dto.FoodGoodsDTO;
import com.teach.food.entity.FoodGoods;
import com.teach.food.entity.FoodMerchant;

public interface FoodGoodsMapper {
    int deleteByPrimaryKey(Integer foodGoodsId);

    int insert(FoodGoods record);
 
    int insertSelective(FoodGoods record);

    FoodGoods selectByPrimaryKey(Integer foodGoodsId);

    int updateByPrimaryKeySelective(FoodGoods record);

    int updateByPrimaryKey(FoodGoods record);
    
    @Select("SELECT * FROM  food_goods INNER JOIN  food_merchant ON food_goods_merchant_id= food_merchant_id  WHERE  food_merchant_id=${foodMerchantId} ORDER BY food_goods_price ASC;")
    List<FoodGoods> list(FoodMerchant fGoodsid);
     
    List<FoodGoods> select(FoodGoodsDTO search);
  
    @Select("select * from food_goods where   food_goods_merchant_id=#{foodGoodsMerchantId}")
    List<FoodGoods> selectAll(FoodGoods foodId);
    @Select("select * from food_goods where food_goods_merchant_id=#{foodGoodsMerchantId}")
    List<FoodGoods> selectByfoodGoodsMerchantId(@Param("foodGoodsMerchantId")Long foodGoodsMerchantId);
}